package com.trkj.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.trkj.pojo.Dept;

public interface DeptDAO extends JpaRepository<Dept, Integer>,JpaSpecificationExecutor<Dept> {
	/**
	 * 查询所有部门
	 * @return
	 * wsf
	 */
	@Query("select new com.trkj.pojo.Dept(d.deptId, d.deptName) from Dept d order by d.deptId desc")
	public List<Dept> queryAllDept();
	/**
	 * 
	 * 根据部门id查询除该部门外的其他的部门
	 * wsf
	 */
	@Query("select new com.trkj.pojo.Dept(d.deptId, d.deptName) from Dept d where d.deptId != ?1")
	public List<Dept> queryOtherDept(Integer integer);
	
}
